﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="adm_cat.aspx.cs" Inherits="Admin_adm_cat" Title="Untitled Page" %>
<%@ Register src="UserControls/AdminMenuLeft.ascx" tagname="AdminMenuLeft" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
	<div class="adm-wrap">
		<h3>Categories-Add</h3>
		<div class="cat">
			<p class="hi"><asp:Label ID="lblGretting" Text="Hi admin Khuong luu" runat="server"></asp:Label></p>
			<p class="hi"><asp:Label ID="lblAlert" runat="server" 
                    style="border:solid 1px Gray;padding:3px" Visible="False"></asp:Label></p>
            <!--Cat Inside-->
		  	<div class="cat_inside fl">
            	<div class="top_b" style="margin-bottom:7px;">
                	<asp:Button Cssclass="submitbutton" Id="btnExpandAll" Text="Expand All" 
                        runat="server" onclick="btnExpandAll_Click" CausesValidation="False" 
                        Width="80px" />
                    <asp:Button Cssclass="submitbutton" Id="btnCollapseAll" Text="Collapse All" 
                        runat="server" onclick="btnCollapseAll_Click" CausesValidation="False" 
                        Width="80px" />
                    <asp:Button Cssclass="submitbutton" Id="btnUpdateOrder" Text="Update Tree" 
                                runat="server" onclick="btnUpdateOrder_Click" 
                                ValidationGroup="1" Width="80px" CausesValidation="False"/>
                    <div class="clear"></div>
                </div>
           	  	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:solid 1px black">
                    <tr class="first" >
                    	<td colspan="2">&nbsp;Main Categories</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td><label for="group">&nbsp; Group</label>
                    	    <asp:DropDownList ID="drpGroup" runat="server" Cssclass="medium">
                            </asp:DropDownList>
                    	</td>
                    	<td>&nbsp;</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td><label for="nameVN">&nbsp; Name-VN</label><asp:TextBox id="txtNameVN" Cssclass="medium" runat="server"/></td>
                    	<td>&nbsp;</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td><label for="nameEN">&nbsp; Name-EN</label><asp:TextBox id="txtNameEN" Cssclass="medium" runat="server"/>
                    	<asp:Button Cssclass="submitbutton" Id="btnAddCategory" Text="Add" runat="server" onclick="btnAddCategory_Click" ValidationGroup="1"/>
                    	<asp:Button Cssclass="submitbutton" Id="btnUpdateCategory" Text="Update" runat="server" onclick="btnUpdateCategory_Click" Visible="False" ValidationGroup="1" Width="50px"/>
                    	
                        </td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr style="background-color:#6B5A60">
                        <td colspan="2" style="height:0px;background-color:Gray">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="** Enter EN text" ControlToValidate="txtNameEN" 
                                ValidationGroup="1"></asp:RequiredFieldValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ErrorMessage="| Enter VN text" ControlToValidate="txtNameVN" 
                                ValidationGroup="1"></asp:RequiredFieldValidator>
                            <asp:Label ID="lblMemory" runat="server" Visible="False"></asp:Label>
                        </td>
                    </tr>
                    <%= _maintable%>
           	  	</table>
          	</div>
            <!--//Cat Inside-->
            
            <!--Cat Inside SE-->
            <div class="cat_inside_se fr">
            	<div class="top_b" style="margin-bottom:7px;">
                	<asp:Button Cssclass="submitbutton" Id="btnAddToMainCategories" 
                        Text="Add to Main Categories" runat="server" CausesValidation="False" 
                        onclick="btnAddToMainCategories_Click" Width="160px" />
                    <div class="clear"></div>
                </div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:solid 1px black">
                    <tr class="first">
                    	<td colspan="2">&nbsp;Sub Categories</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td>
                        	<label for="nameVN">&nbsp; Name-VN</label>
                            <asp:TextBox id="txtSubnameVN" Cssclass="medium" runat="server"/>
                    	</td>
                    	<td>&nbsp;</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td><label for="nameEN">&nbsp; Name-EN</label><asp:TextBox id="txtSubnameEN" Cssclass="medium" runat="server"/>
                        </td>
                    	<td>&nbsp;</td>
                    </tr>
                    <tr class="second" style="background-color:#6B5A60">
                    	<td><label for="nameEN">&nbsp; Order no</label><asp:TextBox id="txtCatOrdering" 
                                Cssclass="medium" runat="server" 
                                ToolTip="0- khong hien thi , &gt;=1 - hien thi"/>
                    	<asp:Button Cssclass="submitbutton" Id="btnAddSubCategory" Text="Add" runat="server" onclick="btnAddSubCategory_Click" ValidationGroup="2"/>
                    	    <asp:Button Cssclass="submitbutton" Id="btnUpdateSubcategory" Text="Update" runat="server" onclick="btnUpdateSubcategory_Click" Visible="False" ValidationGroup="2" Width="50px"/>
                    	</td>
                    	<td>&nbsp;</td>
                    </tr>
                    <tr style="background-color:#6B5A60">
                        <td colspan="2" style="height:0px;background-color:Gray">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="** Enter EN text" ControlToValidate="txtSubnameEN" ValidationGroup="2"></asp:RequiredFieldValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ErrorMessage="| Enter VN text " ControlToValidate="txtSubnameVN" 
                                ValidationGroup="2"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="txtCatOrdering" ErrorMessage="| Enter number" 
                                ValidationExpression="d{1,5}"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        <asp:Panel ID="pnlEdit" runat="server" Height="930px" ScrollBars=Vertical>
                            <table width="100%" style="border:none;" cellpadding="0" cellspacing="0">
                                <asp:Repeater ID="rptSubCat" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td style="width:2%">&nbsp;</td>
                                            <asp:Label ID="lblId" runat="server" Text='<%# Eval("SubCatID") %>' Visible="false"></asp:Label>
                                            <td style="width:10%"><asp:CheckBox ID="chkCheck" runat="server" /></td>
                                            <td style="width:68%"><%# Eval("UName") %></td>
                                            <td style="width:20%"><%# _CreateEditSubcategoryRepeater(Int32.Parse(Eval("SubCatId").ToString()))%></td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                           </table> 
                        </asp:Panel>
                        </td>
                    </tr>
           	  	</table>	
            </div>
            <!--//Cat Inside SE-->
            <div class="clear"></div>
                            
		</div>
	</div>
	<div class="clear"></div>
  <!--//Content-->
</asp:Content>

